﻿namespace MetaProperties.Framework
{
    using System;

    /// <summary>
    /// Defines information about a property.
    /// </summary>
    public interface IMetaProperty : IObservable
    {
        /// <summary>
        /// Occurs when the Initialize method has been called.
        /// </summary>
        event EventHandler Initialized;
        
        /// <summary>
        /// Gets the host of the property.
        /// </summary>
        /// <value>The host of the property.</value>
        object Host
        {
            get;
        }

        /// <summary>
        /// Gets the name of the property.
        /// </summary>
        /// <value>The name of the property.</value>
        string PropertyName
        {
            get;
        }

        /// <summary>
        /// Gets the type of the property.
        /// </summary>
        /// <value>The type of the property.</value>
        Type PropertyType
        {
            get;
        }

        /// <summary>
        /// Initializes the IMetaProperty instance with information about
        /// the underlying .NET properties.  Subsequant calls to this
        /// method are ignored by the IMetaProperty implementation.
        /// </summary>
        /// <param name="configuration">The intialization information.</param>
        void Initialize(MetaPropertyConfiguration configuration);
    }
}
